import Vue from "vue";
import Router from "vue-router";
// 引入自己写的layout
import Layout from "@/components/Layout";

Vue.use(Router);
export default new Router({
  routes: [
    {
      path: "/", //根目录路由为/
      component: Layout, //指定使用Layout组件布局
      redirect: "/welcome", //重定向至/home页面
      children: [
        {
          //子菜单信息
          path: "/welcome", //路径
          name: "welcome",
          component: () => import("@/views/welcome/index.vue"), //指定组件
          meta: { title: "首页", access: 0, affix: true },
        },
      ],
    },
    {
      path: "/proudct",
      component: Layout,
      redirect: "/proudct/bankAmountInput",
      meta: { title: "常用组件库" },
      children: [
        {
          path: "/proudct/bankAmountInput",
          name: "bankAmountInput",
          component: () => import("@/views/product/bankAmountInput/index.vue"),
          meta: { title: "BankAmountInput", access: 0, affix: true },
        },
        {
          path: "/proudct/bankClock",
          name: "bankClock",
          component: () => import("@/views/product/bankClock/index.vue"),
          meta: { title: "BankClock", access: 0, affix: true },
        },
        {
          path: "/proudct/bankShandowBox",
          name: "bankShandowBox",
          component: () => import("@/views/product/bankShandowBox/index.vue"),
          meta: { title: "BankShandowBox", access: 0, affix: true },
        },
      ],
    },
    {
      path: "/productMethod",
      component: Layout,
      redirect: "/productMethod/NumToSimplifiedChinese",
      meta: { title: "常用函数库" },
      children: [
        {
          path: "/productMethod/NumToSimplifiedChinese",
          name: "bankAmountInput",
          component: () =>
            import("@/views/productMethod/NumToSimplifiedChinese/index.vue"),
          meta: { title: "NumToSimplifiedChinese", access: 0, affix: true },
        },
      ],
    },
  ],
});
